<template>
	<view class="app">
		<block v-if="info.title">
			<view class="title">{{info.title}}</view>
			<view class="time">{{info.publish_time}}</view>
			<view class="content">{{info.content}}</view>
		</block>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				info: app.globalData.articleDetail
			};
		},
		onLoad() {
			if (this.info.title) {
				uni.setNavigationBarTitle({
					title: this.info.title
				});
			}
		},
		onUnload() {
			app.globalData.articleDetail = {};
		}
	}
</script>

<style lang="scss">
	.app {
		width: 100%;
		padding: 30rpx;
		box-sizing: border-box;
	}
	
	.title {
		width: 100%;
		padding: 30rpx 0 50rpx 0;
		text-align: center;
		font-size: 32rpx;
		color: #333;
		font-weight: bold;
	}
	
	.time {
		text-align: right;
		padding-bottom: 20rpx;
		font-size: 28rpx;
		color: #666;
	}
	
	.content {
		font-size: 30rpx;
		color: #333;
	}
</style>
